package cn.ltgodm.sandbox.utils;

import cn.ltgodm.sandbox.model.dto.LanguageConfig;

import java.util.List;

/**
 * @author ltgodm
 * @date 2024-03-10 16:52:16
 */
public class LanguageUtil {

    public static String getImageName(String language, List<LanguageConfig> languageConfigList){
        return languageConfigList.stream().filter(config -> config.getLanguage().equals(language)).map(LanguageConfig::getImageName).findFirst().orElse(null);
    }

    public static String getContainerName(String language, List<LanguageConfig> languageConfigList){
        return languageConfigList.stream().filter(config -> config.getLanguage().equals(language)).map(LanguageConfig::getContainerName).findFirst().orElse(null);
    }
}
